<?php
$strTableName="company_address";
$_SESSION["OwnerID"] = $_SESSION["_".$strTableName."_OwnerID"];

$strOriginalTableName="contacts";

$gstrOrderBy="";
if(strlen($gstrOrderBy) && strtolower(substr($gstrOrderBy,0,8))!="order by")
	$gstrOrderBy="order by ".$gstrOrderBy;

$g_orderindexes=array();
$gsqlHead="SELECT concat(contacts.company_name, '', contacts.address, '', cities.city_name, '', states.state_name, countries.country_name, pin_code) AS full_addr,  concat(contacts.phone1, '', contacts.phone2, '', contacts.email, '', contacts.website) AS other_addr,  contacts.id,  contacts.company_id,  contacts.address,  contacts.city_id,  contacts.port_id,  contacts.phone1,  contacts.phone2,  contacts.fax1,  contacts.fax2,  contacts.email,  contacts.website,  contacts.`primary`,  contacts.company_name,  cities.city_name,  ports.port_name,  states.state_name,  states.state_code,  cities.city_code,  countries.country_code,  countries.country_name,  contacts.pin_code";
$gsqlFrom="FROM contacts  INNER JOIN cities ON contacts.city_id = cities.id  INNER JOIN ports ON cities.id = ports.city_id AND contacts.port_id = ports.id  INNER JOIN states ON cities.state_id = states.id  INNER JOIN countries ON states.country_id = countries.id";
$gsqlWhereExpr="";
$gsqlTail="";

include(getabspath("include/company_address_settings.php"));

// alias for 'SQLQuery' object
$gQuery = &$queryData_company_address;
$eventObj = &$tableEvents["company_address"];

$reportCaseSensitiveGroupFields = false;

$gstrSQL = gSQLWhere("");


?>